package com.define.ssh.thread;

import org.apache.log4j.Logger;

public class DxThread extends Thread {
	private final Logger log = Logger.getLogger(DxThread.class);
	private final long sleeptime = 5000;

	@Override
	public void run() {
		try {
			boolean t = false;
			while (true) {
				try {
					log.info("----------------------发送短信渠道开始----------------------");
					// 取出状态为： 未发送/发送失败 等待发送的短信记录,每次执行100条短信
					// List<SmsRecord> smsList =
					// smsjdbc.getSmsRecordByIsSend("1", 100);
					t = true;
				} catch (final Exception e) {
					e.printStackTrace();
					log.info(e.getMessage());
				}
				if (t) {// 如果列表没有数据则进行睡眠
					Thread.sleep(sleeptime);// 线程睡眠
				}
			}
		} catch (final Exception e) {
			log.error(e);
		}
	}
}
